﻿using System.Collections.Generic;
using Orchard;
using Contrib.Chapters.Models;

namespace Contrib.Chapters.Services {
    public interface IChapterService : IDependency {
        BookPart GetBook(int id);
        IEnumerable<BookPart> GetBooks();
        BookPart GetBookByName(string name);
        void EditBook(BookPart bookPart, string oldName);
        void DeleteBook(BookPart book);

        ChapterPart GetChapter(int id);
        IEnumerable<ChapterPart> GetChapters(BookPart book);
        void Delete(ChapterPart chapter);
        ChapterPart GetChapterBySlug(string chapterSlug);
        IEnumerable<ChapterPart> GetChildren(ChapterPart chapterPart);
        IEnumerable<ChapterPart> GetDirectChildren(ChapterPart chapterPart);
        IEnumerable<ChapterPart> GetSiblings(ChapterPart chapterPart);

        void CreateChapterContentType(BookPart bookPart);
        void ChangeName(ChapterPart chapterPart, string oldName);
        string GenerateChapterTypeName(string chapterName);
        ChapterPart NewChapter(BookPart book);
        void MoveChapter(BookPart book, ChapterPart chapter, ChapterPart parentChapter);
    }
}